package com.yantong.mapper;

import com.yantong.pojo.ProductComment;
import com.yantong.pojo.vo.LevelVo;
import com.yantong.pojo.vo.ProductCommentListVo;
import com.yantong.pojo.vo.ProductCommentVo;
import org.apache.ibatis.session.RowBounds;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface ProductCommentMapper {
	int countByWhere(Map map);
	List<ProductComment> listByWhere(Map map);
	List<ProductCommentListVo> listByWhere(HashMap<String, Object> map, RowBounds row);
	
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_product_comment
     *
     * @mbg.generated Fri Oct 26 14:16:57 CST 2018
     */
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_product_comment
     *
     * @mbg.generated Fri Oct 26 14:16:57 CST 2018
     */
    int insert(ProductComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_product_comment
     *
     * @mbg.generated Fri Oct 26 14:16:57 CST 2018
     */
    int insertSelective(ProductComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_product_comment
     *
     * @mbg.generated Fri Oct 26 14:16:57 CST 2018
     */
    ProductComment selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_product_comment
     *
     * @mbg.generated Fri Oct 26 14:16:57 CST 2018
     */
    int updateByPrimaryKeySelective(ProductComment record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_product_comment
     *
     * @mbg.generated Fri Oct 26 14:16:57 CST 2018
     */
    int updateByPrimaryKey(ProductComment record);
    
	ProductCommentVo getNewComentByProductId(Long productId);
	String countComentCountByProductId(Long productId);

	BigDecimal getCentreGrade(Map params);

	List<LevelVo> getCommentLevelCount(Map params);
}